<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/jsp/common/include.jsp"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" " http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>主页 | 短信平台</title>
<jsp:include page="/WEB-INF/jsp/common/commonlist.jsp"></jsp:include>
<style>
	#userTable tr{
		background-color:white;
	}
	#userTable td{
		background-color:white;
	}
	
	td.td_title{
		width:80px;
	}
	
	.errorMsg{
		padding-top:9px;
		color:red;
		vertical-align: bottom;
	}
</style>
<script>
$(document).ready(function() {
	$("#editUserForm").validate({
		rules :{ 
			realName:{
	        	required : true,
	        	maxlength : 50
	        },
	        mobile:{
	        	required : true,
	        	number : true,
	        	maxlength : 11
	        },
	        phone:{
	        	number : true,
	        	maxlength : 11
	        },
	        email:{
	        	required : true,
	        	maxlength : 200
	        },
	        password:{
	        	required : true,
	        	maxlength : 100
	        },
	        confirmPassword:{
	        	required : true,
	        	maxlength : 100
	        },
	        birthday:{
	        	maxlength : 100
	        },
	        unit:{
	        	maxlength : 200
	        },
	        address:{
	        	required : true,
	        	maxlength : 100
	        },
	        note:{
	        	required : true,
	        	maxlength : 1000
	        }
		}
	});
});
	function bodyLoad(){
		activeMenuItem("userManageItem","listUserItem");
	}
	
	function submitForm(){
		$("#editUserForm").attr("action","doEditUser.do").submit();
		return false;
	}

	$(document).ready(function() {
		$("#birthday").datepicker();
 
	}); 
</script>
</head>
<body onload="bodyLoad()">
<div id="body-wrapper">
  <!-- Wrapper for the radial gradient background -->
  <div id="sidebar">
    <div id="sidebar-wrapper">
      <!-- Sidebar with logo and menu -->
      <h1 id="sidebar-title"><a href="#">短信平台</a></h1> 
      <!-- Logo (221px wide) -->

      <!-- Sidebar Profile links -->
            <!--  页面左上角的部分 -->
     <%@include file="/WEB-INF/jsp/common/leftTop.jsp" %>
     <!-- 页面左侧菜单部分 -->
     <%@include file="/WEB-INF/jsp/common/menu.jsp" %>
      
    </div>
  </div>
  <!-- End #sidebar -->
  <div id="main-content">
    <!-- Main Content Section with everything -->
    
   <%@ include file="/WEB-INF/jsp/common/top.jsp" %>
    <!-- End .shortcut-buttons-set -->
    <div class="clear"></div>
    <!-- End .clear -->
    <div class="content-box">
      <!-- Start Content Box -->
      <div class="content-box-header">
        <h3>编辑用户信息</h3>
        <p class="errorMsg">${errorMsg}</p>
        <p class="promptMsg">${promptMsg }</p>
      </div>
      <!-- End .content-box-header -->
      <div class="content-box-content">
        <div class="tab-content default-tab" id="tab2">
          <form  id="editUserForm"  name="editUserForm"   method="post"  onsubmit="return submitForm()">
          <input type="hidden" name="id" value="${user.userId }" />
           <table id="userTable">
           <tr>           
              <td class="td_title"><label style="display: inline; width: 90px;">真实姓名：</label></td>
              <td><input class="text-input small-input" type="text" id="realName" name="realName"  value="${user.realName }"/></td>              
            </tr>
            <tr>
              <td><label style="display: inline; width: 90px;">手机：</label></td>
              <td><input class="text-input small-input" type="text" id="mobile" name="mobile"  value="${user.mobile }"/></td>
             </tr>
            <tr>
              <td><label style="display: inline; width: 90px;">电话：</label></td>
              <td><input class="text-input small-input" type="text" id="phone" name="phone"  value="${user.phone }"/></td>              
             </tr>
            <tr>
              <td><label style="display: inline; width: 90px;">邮箱：</label></td>
              <td><input class="text-input small-input" type="text" id="email" name="email"  value="${user.email }"/>（用户登录邮箱）</td>              
              </tr>
            
             <tr>
             <td>  <label style="display: inline; width: 90px;">密码：</label></td>
              <td><input class="text-input small-input" type="password" id="password" name="password"  value="${user.password }"/></td>              
             </tr>
            <tr>
            <td><label style="display: inline; width: 90px;">确认密码：</label></td>
              <td><input class="text-input small-input" type="password" id="confirmPassword" name="confirmPassword" value="${user.password }"></td>              
              </tr>
            <tr>
            <td> <label style="display: inline; width: 90px;">生日：</label></td>
             <td><input class="text-input small-input" type="text" id="birthday"   readonly="readonly" name="birthday"  value="${user.birthDay }"/></td>            
              </tr>
            <tr>
            	<td><label style="display: inline; width: 90px;">单位：</label></td>
              <td><input class="text-input medium-input datepicker" type="text" id="unit" name="unit"  value="${user.unit }"/></td>
			</tr>
			<tr>
			<td> <label style="display: inline; width: 90px;">地址：</label></td>
              <td><input class="text-input medium-input datepicker" type="text" id="address" name="address"  value="${user.address }"/></td>
			</tr>
            <tr>
            <td> <label style="display: inline;">性别：</label></td>
            <td>
            	<c:choose>
            		<c:when test="${user.sex eq '男' }">
            			<input type="radio" name="sex"  value="男" checked/>男&nbsp;&nbsp;
              			<input type="radio" name="sex"  value ="女"/>女		
            		</c:when>
            		
            		<c:when test="${user.sex eq '女' }">
            			<input type="radio" name="sex"  value="男" checked/>男&nbsp;&nbsp;
              			<input type="radio" name="sex"  value ="女"  checked/>女		
            		</c:when>
            		
            		<c:otherwise>
            			<input type="radio" name="sex"  value="男" />男&nbsp;&nbsp;
              			<input type="radio" name="sex"  value ="女"/>女
            		</c:otherwise>
            	</c:choose>
              
              </td>
            </tr>
            <tr>
            	<td>
            		是否需要审核
            	</td>
            	<td>
            		<c:choose >
            			<c:when test="${user.audit }">
            				<input type="radio" name="isAudit"  checked   value="true" />是&nbsp;&nbsp;
              				<input type="radio" name="isAudit"  value ="false"/>否
            			</c:when>
            			<c:otherwise>
            				<input type="radio" name="isAudit"  value="true" />是&nbsp;&nbsp;
              				<input type="radio" name="isAudit"  checked value ="false"/>否
            			</c:otherwise>
            		</c:choose>
            		
            	</td>
            </tr>
            <tr>
            <td style="vertical-align: top;">
              <label>备注：</label>
             </td>
             <td>
              <textarea class="text-input textarea wysiwyg" id="note" name="note" cols="79" rows="15"  >${user.note }</textarea>
              </td>
            </tr>
            <tr>
            	<td style="text-align: center;" colspan="2">
              		<input class="button" type="submit" value="保存用户信息" />
				</td>
			</tr>
           </table>
            <div class="clear"></div>
            <!-- End .clear -->
          </form>
        </div>
        <!-- End #tab2 -->
      </div>
      <!-- End .content-box-content -->
    </div>
    <!-- End .content-box -->
    <div class="clear"></div>
    <%@ include file="/WEB-INF/jsp/common/copyright.jsp" %>
  </div>

</div>
</body>
</html>